package com.hyzhangjr.webdemo.controller;


import com.hyzhangjr.starter.demo.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    //自定义starter中引入
    @Autowired
    HelloService helloService;

    @RequestMapping(value="/hello")
    public String index(){
        return "Hello,Greetings from Spring Boot!";
    }

    @RequestMapping(value = "/starterdemo")
    public String sayHello(){
        return helloService.sayHello();
    }

}
